<!--
 * @Author: Bo Cai
 * @Mail: caibo0520@qq.com
 * @Date: 2021-12-14 20:24:04
 * @LastEditors: Bo Cai
 * @LastEditTime: 2021-12-25 23:13:35
-->
<template>
  <div class="dashboard-container">
    <div class="dashboard-text"><el-image :src="url"></el-image></div>
    <div class="dashboard-text">用户名：{{ name }}</div>
    <div class="dashboard-text">
      用户角色：<span v-for="role in roles" :key="role">{{ role }}</span>
    </div>
    <div class="dashboard-text">
      <el-image :src="avatar" style="width: 200px; height: 200px"></el-image>
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'

export default {
  data() {
    return {
      url: 'https://caibo-0520.oss-cn-shenzhen.aliyuncs.com/logo/%E4%BD%9B%E7%A7%91%E5%9C%A8%E7%BA%BF%E5%AD%A6%E9%99%A2logo.png',
    }
  },
  name: 'Dashboard',
  computed: {
    ...mapGetters(['name', 'roles', 'avatar']),
  },
}
</script>

<style rel="stylesheet/scss" lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-text {
    font-size: 24px;
    line-height: 50px;
  }
}
</style>
